﻿using System;
using CrateMayhem.Common.Services;
using CrateMayhem.WinRT.Controls;

namespace CrateMayhem.WinRT.Services
{
    public class AutoCloseDialogService : IAutoCloseDialogService
    {
        public event EventHandler Closed;

        public void ShowDialog(string message, int delayBeforeClose = 3000)
        {
            var dialog = new AutoCloseDialog(this);
            dialog.ShowDialog(message, delayBeforeClose);
        }

        public void Close()
        {
            if (Closed != null)
            {
                Closed(this, EventArgs.Empty);
            }
        }
    }
}